package cn.com.dhc.danlu.widget.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * User: Geek_Soledad(wuhaiyang@danlu.com)
 * Date: 2016-09-23
 * Time: 10:44
 * Description: .....
 */
public abstract class BaseFragmentPagerAdapter extends FragmentPagerAdapter {
    private String[] mTitle;

    protected BaseFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
        mTitle = initTitles();
    }

    protected abstract String[] initTitles();

    @Override
    public abstract Fragment getItem(int position);

    @Override
    public int getCount() {
        return mTitle.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitle[position];
    }
}
